import java.util.Arrays;
import java.util.Random;

public class ArrayClassObj {
    public static void main(String[] args) {
        Random rand = new Random();
        Integer[] a = new Integer[rand.nextInt(20)];
        System.out.println("Length of a = " + a.length);
        // 直到通过自动装箱为数组里的每个引用本身初始化了一个Integer对象之后，这个数组的初始化才真正结束
        for (int i = 0; i < a.length; i++) {
            a[i] = rand.nextInt(1000);
        }
        System.out.println(Arrays.toString(a));
    }
}
